from kittentts import KittenTTS
import os

os.environ['HF_ENDPOINT'] = 'https://hf-mirror.com'
m = KittenTTS("KittenML/kitten-tts-nano-0.2")

# audio = m.generate(" This high quality TTS model works without a GPU  U", voice='expr-voice-2-f' )
audio = m.generate("   Hello , How are you U", voice='expr-voice-2-f' )

# available_voices : [  'expr-voice-2-m', 'expr-voice-2-f', 'expr-voice-3-m', 'expr-voice-3-f',  'expr-voice-4-m', 'expr-voice-4-f', 'expr-voice-5-m', 'expr-voice-5-f' ]

# Save the audio
import soundfile as sf
sf.write('output8.wav', audio, 24000)